package com.wz.project.bas.warehouse.service;

import com.wz.common.utils.text.Convert;
import com.wz.project.bas.warehouse.domain.BasWarehouse;
import com.wz.project.bas.warehouse.mapper.WarehouseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WarehouseServiceImpl implements WarehouseService{

    @Autowired
    WarehouseMapper warehouseMapper;

    @Override
    public List<BasWarehouse> selectWarehouseList(BasWarehouse basWarehouse) {
        return warehouseMapper.selectWarehouseList(basWarehouse);
    }

    @Override
    public int deleteWarehouseByIds(String ids) {
        String[] userIds = Convert.toStrArray(ids);
        return warehouseMapper.deleteWarehouseByIds(userIds);
    }

    @Override
    public BasWarehouse selectWarehouseByWarehouseId(String warehouse_id) {
        return warehouseMapper.selectWarehouseByWarehouseId(warehouse_id);
    }

    @Override
    public int saveAndUpdate(BasWarehouse basWarehouse) {
        return warehouseMapper.saveAndUpdate(basWarehouse);
    }

    @Override
    public int insertWarehouse(BasWarehouse basWarehouse) {
        return warehouseMapper.insertWarehouse(basWarehouse);
    }
}
